﻿Imports System.Xml.Serialization
Imports KanBan.Pgd.Common

Namespace Resources

    <XmlType(AnonymousType:=True), _
     XmlRoot(ElementName:="grouppermissions", [Namespace]:="", IsNullable:=False)> _
    Partial Public Class GroupPermissionResource

        Private _groupPermissions() As GroupPermissionItem

        <XmlElement("grouppermission", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property GroupPermissions() As GroupPermissionItem()
            Get
                Return _groupPermissions
            End Get
            Set(ByVal value As GroupPermissionItem())
                _groupPermissions = value
            End Set
        End Property

        Public Shared Function GetResource() As GroupPermissionResource
            Return XmlDeserializer(Of GroupPermissionResource).Deserialize("Resources\GroupPermissions.xml")
        End Function

    End Class

    <XmlType(AnonymousType:=True)> _
    Partial Public Class GroupPermissionItem

        Private _groupId As String

        Private _permissionId As String

        <XmlAttribute("groupId")> _
        Public Property GroupId() As String
            Get
                Return Me._groupId
            End Get
            Set(ByVal value As String)
                Me._groupId = value
            End Set
        End Property

        <XmlAttribute("permissionId")> _
        Public Property PermissionId() As String
            Get
                Return Me._permissionId
            End Get
            Set(ByVal value As String)
                Me._permissionId = value
            End Set
        End Property
    End Class

End Namespace
